#!/usr/bin/env bash

root=../../../
services=(${root}Alumni-Eureka ${root}Alumni-Zuul ${root}Alumni-Service/User-Service ${root}Alumni-Service/School-Service)

function build() {
    cd $1
    mvn clean
    mvn docker:removeImage
    mvn package
    mvn docker:build
}

current=$(pwd)

for service in ${services[*]}
do
    echo 'building '${service}'...'
    sleep 3
    build ${service}
    cd ${current}
done

echo 'done.'